<!doctype html>
<html class="no-js">

<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>{$system_name}</title>
    <!-- set render engine for 360 browser -->
    <meta name="renderer" content="webkit">
    <!-- no baidu siteapp-->
    <meta http-equiv="cache-control" content="no-siteapp"/>
    <!-- add to homescreen for chrome on android -->
    <meta name="mobile-web-app-capable" content="yes">
    <!-- add to homescreen for safari on ios -->
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-title" content="amaze ui"/>
    <!-- tile icon for win8 (144x144 + tile color) -->
    <meta name="msapplication-tilecolor" content="#0e90d2">
    <!-- seo: if your mobile url is different from the desktop url, add a canonical link to the desktop page https://developers.google.com/webmasters/smartphone-sites/feature-phones -->
    <!--
  <link rel="canonical" href="http://www.example.com/">
  -->
    <link rel="stylesheet" href="__PUBLIC__/assets/css/amazeui.min.css">
    <link rel="stylesheet" href="__PUBLIC__/assets/css/app.css">
    <link rel="stylesheet" href="__PUBLIC__/assets/css/layout.css">
    <link rel="stylesheet" href="__PUBLIC__/assets/css/demo.css">
    <!--必要样式-->
    <style>
        body {
            background: url("__PUBLIC__/images/draw/bg.png");
            background-size: 100% 100%;
        }

        .list li{
            background: url("__PUBLIC__/images/draw/box_bg.png") no-repeat;
            background-size: contain;
        }
        .list li img{
            padding: 8px;

        }


        .eggbox{
            height: auto;
            padding: 10px 10px;
            background: url("__PUBLIC__/images/draw/big_box_bg.png") no-repeat;
            background-origin:content-box;
            -webkit-background-size:100% 100%;
            background-size:100% 100%;
        }
        p{
            color: #36AFE2;
            font-size:12px ;
            margin: 0;
            line-height: 24px;
        }

    </style>

</head>

<!--金币抽奖页-->
<body>
<header data-am-widget="header" class="am-header am-header-default">
    <div class="am-header-left am-header-nav">
        <a href="__APP__/Home/Goods" class="">
            <img src="__PUBLIC__/assets/i/left.png" alt="" style="margin: 5px">
        </a>
    </div>
    <h1 class="am-header-title">
        <a href="#title-link" class="">
            欢乐砸金蛋
        </a>
    </h1>
</header>
<div class="am-g">
    <div class="am-u-sm-12 am-padding-0">
        <img src="__PUBLIC__/images/draw/top_bg.png" width="100%" alt="">
    </div>
</div>

<div class="am-g">
    <a href="__URL__/lotteryLog">
        <div class="am-u-sm-6 am-text-center">
            <img src="__PUBLIC__/images/draw/btn1.png" width="85%" alt="">
        </div>
    </a>
    <a href="__URL__/acceptLog">
        <div class="am-u-sm-6 am-text-center">
            <img src="__PUBLIC__/images/draw/btn2.png" width="85%" alt="">
        </div>
    </a>
</div>
<div class="am-g">
    <div class="am-u-sm-12 am-text-center am-margin-top-xs">
        <img src="__PUBLIC__/images/draw/title1.png" width="70%" alt="">
    </div>
</div>

<div class="wrap-content scroll_horizontal" id="pic_list_2">
    <div class="box">
        <ul class="list">
            <volist name="prizeList.list" id="prize">
                <li><a href="#"><img src="__ROOT__/{$prize.image_url}" width="70" height="60" alt=""></a></li>
            </volist>
        </ul>
    </div>
</div>


<div class="am-g eggbox">
    <div class="am-u-sm-4 am-text-center am-padding-0 open">
        <img src="__PUBLIC__/images/draw/egg.png" width="100%" alt="">
    </div>
    <div class="am-u-sm-4 am-text-center am-padding-0 open">
        <img src="__PUBLIC__/images/draw/egg.png" width="100%" alt="">
    </div>
    <div class="am-u-sm-4 am-text-center am-padding-0 open">
        <img src="__PUBLIC__/images/draw/egg.png" width="100%" alt="">
    </div>
    <div class="am-u-sm-4 am-text-center am-padding-0 open">
        <img src="__PUBLIC__/images/draw/egg.png" width="100%" alt="">
    </div>
    <div class="am-u-sm-4 am-text-center am-padding-0 open">
        <img src="__PUBLIC__/images/draw/egg.png" width="100%" alt="">
    </div>
    <div class="am-u-sm-4 am-text-center am-padding-0 open">
        <img src="__PUBLIC__/images/draw/egg.png" width="100%"alt="">
    </div>
</div>

<div class="am-g">
    <div class="am-u-sm-12 am-text-center am-margin-top-xs">
        <img src="__PUBLIC__/images/draw/title2.png" width="70%" alt="">
    </div>
</div>
<div class="am-g">
    <div class="am-u-sm-12" style="padding: 12px;margin-bottom: 30px" >
        {$lottery_rules}
    </div>
</div>
<!--[if (gte ie 9)|!(ie)]><!-->
<script src="__PUBLIC__/assets/js/jquery.min.js"></script>
<script src="__PUBLIC__/assets/js/angular.min.js"></script>
<script src="__PUBLIC__/assets/js/amazeui.min.js"></script>
<script src="__PUBLIC__/layer/layer.js"></script>
<style>
    .layui-layer-btn{
        text-align: center;
    }
</style>
<script src="__PUBLIC__/assets/js/jquery.cxscroll.min.js"></script>
<script type="text/javascript">

    $("#pic_list_2").cxScroll({
        time: 1000
    });
    $('.eggbox .open').each(function(index){
        $(this).click(function(){
            var money = '{$money}';
            layer.confirm('本次抽奖需要消耗'+money+'金币，是否进行抽奖？', {
                btn: ['确定','取消'] //按钮
            }, function(){
                $.ajax({
                    type: "POST",
                    url: "__URL__/lottery",
                    dataType: "json",
                    success: function (data) {
                        console.info(data);
                        if(data.success){
                            if(data.data.type == 3){
                                layer.msg('<img src="__ROOT__/{$qr_code}" width="100" alt=""><br>'+data.message, {
                                    time: 20000, //20s后自动关闭
                                    btn: ['领取'],
                                },function () {
                                    window.location.href='__APP__/Home/Lottery/awardCode';
//                                    console.info('aaa');
                                });
                            }else{
                                layer.msg('<img src="__PUBLIC__/images/draw/eggopen.png" width="100" alt=""><br>'+data.message+'<br/>', {
                                    time: 20000, //20s后自动关闭
                                    btn: ['继续抽奖'],
                                });
                            }

//                        $('.eggbox .open').unbind('click');
                        }else{
                            layer.msg(data.message);
                        }
                    },
                    error: function (data) {
                        console.info(data);
                    }
                });
            }, function(){

            });

//
        })
    })
</script>

</body>
</html>

